package demo1;

public class Test {
    public static void main(String[] args) {
        MyArraylist myArraylist = new MyArraylist();
        myArraylist.add(23);
        myArraylist.display();
        try {
            myArraylist.add(1,23);
            myArraylist.contains(23);
            myArraylist.display();
            myArraylist.indexOf(23);
            myArraylist.display();
            myArraylist.get(2);
            myArraylist.display();
            myArraylist.set(2,99);
            myArraylist.display();
            myArraylist.remove(23);
            myArraylist.display();
        }catch (CheckPosInAddException e){
            e.printStackTrace();
            System.out.println("捕捉到了 CheckPosInAddException 异常");
        }catch (CheckGetPosException e) {
            e.printStackTrace();
            System.out.println("捕捉到了   CheckGetPosException 异常");
        }
        myArraylist.display();
        System.out.println("============");









    }
}
